using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace CinemaLib
{
    /// <summary>
    /// Contains information about Movie which gets sent via WCF.
    /// </summary>
    [DataContract]
    public class Movie
    {
        [DataMember]
        public int ID { get; private set; }
        [DataMember]
        public bool ThirdDimension { get; set; }
        [DataMember]
        public byte AgeLimit { get; set; }
        [DataMember]
        public string Description { get; set; }
        [DataMember]
        public Genre Genre { get; set; }
        [DataMember]
        public Language Language { get; set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public TimeSpan RunTime { get; set; }
        [DataMember]
        public Language Subtitles { get; set; }

        //internal int ID { get { return (ThirdDeminsion + Language.ToString() + Name + Subtitles.ToString()).GetHashCode(); } }

        public Movie(string _name,  string _describtion, byte _agelimit, Language _language,
            Language _subtitles, Genre _genre, TimeSpan _runtime, bool _thirdDimension)
        {
            Name = _name;
            Description = _describtion;
            AgeLimit = _agelimit;
            RunTime = _runtime;
            Genre = _genre;
            Language = _language;
            Subtitles = _subtitles;
            ThirdDimension = _thirdDimension;
        }

        public Movie(int _id, string _name, string _describtion, byte _agelimit, Language _language,
            Language _subtitles, Genre _genre, TimeSpan _runtime, bool _thirdDimension)
        {
            ID = _id;
            Name = _name;
            Description = _describtion;
            AgeLimit = _agelimit;
            RunTime = _runtime;
            Genre = _genre;
            Language = _language;
            Subtitles = _subtitles;
            ThirdDimension = _thirdDimension;
        }
    }

    /// <summary>
    /// Enums with Genres to choose from.
    /// </summary>
    [DataContract(Name = "Genre")]
    public enum Genre
    {
        [EnumMember]Action, [EnumMember]Adventure, [EnumMember]Animation, [EnumMember]Biography, [EnumMember]Comedy, [EnumMember]Crime,
        [EnumMember]Documentary, [EnumMember]Drama, [EnumMember]Family, [EnumMember]Fantasy, [EnumMember]History, [EnumMember]Horror,
        [EnumMember]Musical, [EnumMember]Mystery, [EnumMember]News, [EnumMember]Romance, [EnumMember]SciFi, [EnumMember]Sport, [EnumMember]Thriller, [EnumMember]Western,
    }

    /// <summary>
    /// Enums with Languages to choose from.
    /// </summary>
    [DataContract(Name = "Language")]
    public enum Language
    {
        [EnumMember]English, [EnumMember]Danish, [EnumMember]Swedish, [EnumMember]Norwegian, [EnumMember]Spanish, [EnumMember]French,
        [EnumMember]Italian, [EnumMember]German, [EnumMember]Japanese, [EnumMember]Chinese, [EnumMember]OTHER, [EnumMember]None,
    }
}
